Release 10.1A: OpenEdge Development:
.NET Open Clients
ProDataSet examples
This section provides some code examples for ProDataSets.
Note: These samples are not available on the Documentation and Samples CD or Progress Documentation Web site.Sample static ProDataSet
Example 4–6 is a static ProDataSet definition in a persistent procedure,
CustomersAndOrders.p.
For this parameter, ProxyGen generates the following:
Example 4–7 is a static ProDataSet definition in an external procedure,
SetCustomersAndOrders.p.
Since the schema for these two static DataSet parameters is the same, ProxyGen uses the previously generated, strongly typed DataSet in the proxy method generated for this external procedure. For example:
For
INPUTandINPUT-OUTPUTparameters, the .NET client code must supply an instance of the strongly typed DataSet object. ForOUTPUTparameters, the strongly typed DataSet variable must be declared, but the instance is created by Progress and returned to the .NET client as a parameter.Sample DATASET-HANDLE parameter
Example 4–8 is a
DATASET-HANDLEparameter.
For this parameter, ProxyGen generates the following method in the proxy:
For
INPUTandINPUT-OUTPUTparameters, the .NET client code must supply an instance of theSystem.Data.DataSetobject. ForOUTPUTparameters, the DataSet variable must be declared, but the instance is created by Progress and returned to the .NET client as a parameter.Sample .NET Open Client application using a ProDataSet
Example 4–9 shows sample code for calling a procedure with a ProDataSet.
Sample ProDataSet update
The code examples in this section show how to pass a changes-only DataSet (that is, a DataSet that contains only records that have been added, updated, or deleted) to the AppServer and properly process the changes.
Example 4–10 shows one way to handle updates in a .NET Open Client environment.
Note: For the sake of simplicity, this example does not include standard error checking. Make sure that you include error checking in your application code.
Example 4–11 shows temp-table definitions in a 4GL include file, sOrderTables.i.
Example 4–12 shows a static ProDataSet definition in a 4GL include file,
dsOrderDef.i.
Example 4–13 shows a 4GL procedure that updates the database with a DataSet that contains only records that have been modified (added, updated, or deleted).
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |